import { Login } from "@/api/interface/index";
// import { PORT1 } from "@/api/config/servicePort";
// import authMenuList from "@/assets/json/authMenuList.json";
// import authButtonList from "@/assets/json/authButtonList.json";
import http from "@/api";

/**
 * @name 登录模块
 */
// 用户登录
export const loginApi = (params: Login.ReqLoginForm) => {
  return http.post<Login.ResLogin>(`/login`, params, { loading: false });
};

// 用户退出登录
export const logoutApi = () => {
  return http.post(`/logout`);
};

// 获取菜单列表
export const getAuthMenuListApi = () => {
  return http.get<any[]>(`/getRoutes`, {}, { loading: false });
};

// 获取按钮权限
export const getAuthButtonListApi = () => {
  return http.get<Login.ResAuthButtons>(`/getPermissions`, {}, { loading: false });
};

// 获取用户信息
export const getUserInfoApi = () => {
  return http.get<Login.ResUserInfo>(`/getInfo`, {}, { loading: false });
};
